<%@page import="org.jsoup.Jsoup"%>
<%@page import="org.jsoup.nodes.Document"%>
<%@page import="org.jsoup.select.Elements"%>
<%@page import="controller.Utils"%>
<%@page contentType="text/html;charset=UTF-8" language="java"%>
<%
	String domain = (String) request.getAttribute("domain");
	String reciprocal = (String) request.getAttribute("reciprocal");
	String strs = (String) request.getAttribute("strs");
	String title = "Domain Promo Codes";
	String description = "Daily update a complete list of domain promo codes and promo codes.You can use GoDaddy Promo Coupons,Namecheap Coupons,and other domain coupons to purchase domains save money.";
	String keyword = "Promo Codes,domain,Coupon Codes";

	Elements element = null;
	try{
		Document doc = Jsoup.parse(Utils.GetHtml(
		"http://domainpromocodes.com/", "utf-8"));
	
		element = doc.select(".promo_box");
	} catch (Exception e){
		
	}
%>

<jsp:include page="layout/header.jsp">
	<jsp:param name="title" value="<%=title%>" />
	<jsp:param name="description" value="<%=description%>" />
	<jsp:param name="keywords" value="<%=keyword%>" />
	<jsp:param name="menu" value="pro" />
</jsp:include>

<div class="bd">
		<div class="l">
			<div class="rib">
				<h1>Domain Promo Codes</h1>
			</div>
			<div class="cont">
				<p>
					Daily update a complete list of domain <strong>promo codes</strong>
					and <i>promo codes</i>.You can use GoDaddy Promo Coupons,Namecheap
					Coupons,and other domain coupons to purchase domains save money.
				</p>
				
				<div class="network">
					<script type="text/javascript" src="/js/jquery.zclip.min.js"></script>
            
					<table class="promocode">
						<%
						if(element!=null)
						{
							for (int i = 0; i < element.size(); i++) {
						%>
						<tr>
							<td class="one" valign="top"><img
								src="http://www.domainpromocodes.com/<%=element.get(i).select(".pic img").attr("src")%>" /></td>
								<td valign="top">
									<strong><%=element.get(i).select(".title_1").text()%></strong>
									<div class='copy' ><span id='code<%=i %>'><%=element.get(i).select(".crux").text()%></span><span class='info right' id='info<%=i%>'></span></div>
									<input type="hidden" value="<%=element.get(i).select("input").val()%>" id="redirect<%=i%>"/>
									<script language="JavaScript">
										var clip<%=i %> = new ZeroClipboard.Client(), myTextToCopy<%=i %> = document.getElementById("code<%=i %>").innerHTML;
										clip<%=i %>.glue('code<%=i %>');
										clip<%=i %>.addEventListener('onMouseOver', clipboardEvent);
										function clipboardEvent() {
											clip<%=i %>.setText(myTextToCopy<%=i %>);
										}
										clip<%=i %>.addEventListener('onComplete', clipboardEvent1);
										function clipboardEvent1() {
											window.open(document.getElementById("redirect<%=i%>").value,"_blank");
										}
									</script>			
									<p><%=element.get(i).select(".txt").html()%></p>
								</td>
						</tr>
						<%
							}
						} else {
							out.print("No Promo Codes");
						}
						%>
						
					</table>
					
				</div>
			</div>
		</div>
		<div class="r">
			<%@ include file='/element/search.jsp'%>
			
			<div class="bol">
				<jsp:include page="adv/adv2.jsp"></jsp:include> 
			</div>
			<div class="bol">
				<jsp:include page="adv/adv2.jsp"></jsp:include> 
			</div>
		</div>
	</div>

<script type="text/javascript" src="/js/jquery.js"></script> 
<script type="text/javascript">
	$(document).ready(function(){
		$(".copy").hover(
		  	function () {
		  		$(this).find(".info").html("Click code to copy !!!");
		  	},
		  	function () {
		  		$(this).find(".info").html("");
		  	}
		);
	});
	
</script>

<jsp:include page="layout/footer.jsp"></jsp:include>
